﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Net.Http;

namespace CanDoo.Oil.WebApi.UnitTestProject
{
    [TestClass]
    public class UnitTest1
    {
        private ApiHelper api;
        public UnitTest1()
        {
            api = new ApiHelper();
        }

        //[TestMethod]
        //public void Test_api_pad_PullSellingConfigInfo()
        //{
        //    var url = "_api_pad_PullSellingConfigInfo";
        //    api.DoPost(url)
        //}

        [TestMethod]
        public void Test_get()
        {
            //var url = "/api/pad/PullStoreCampaign";
            var url = "http://localhost:2322/api/hello";
            var rtn = api.DoGet(url, new System.Collections.Generic.Dictionary<string, string>()).Result;
            Console.Write(rtn);
            Assert.IsNotNull(rtn);
        }

        [TestMethod]
        public void Test_post()
        {
            //var url = "/api/pad/PullStoreCampaign";
            var url = "http://localhost:2322/api/hello";
            var rtn = api.DoPost(url,"").Result;
            Console.Write(rtn);
            Assert.IsNotNull(rtn);
        }

        [TestMethod]
        public void Test_api_pad_PullStoreCampaign()
        {
            //var url = "/api/pad/PullStoreCampaign";
            var url = "http://localhost:2322/api/hello";
            var rtn = api.DoGet(url, new System.Collections.Generic.Dictionary<string, string>()).Result;
            Console.Write(rtn);
            Assert.IsNotNull(rtn);
        }
    }
}
